package com.email;

import lombok.Builder;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 刘志伟
 * @create 2023/3/6 16:51
 */
@SpringBootApplication
@RestController
public class EmailApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(EmailApplication.class, args);
    }

    @PostMapping("/validation")
    @ResponseBody
    public Boolean validation(@RequestBody Args args){
        //email = "903109360@qq.com";
        Boolean result = CheckEmailValidation.isEmailValid(args.getEmail());
        return result;
    }

    @Override
    public void run(String... args) throws Exception {

    }
}

@Data
 class Args{

    private String email;
}
